﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;

namespace Pay.DTO.htl {

    #region 公共基础类
    /// <summary>
    /// 请求基础数据
    /// </summary>
    public class htl_req_base {
        /// <summary>
        /// 
        /// </summary>
        public htl_req_base() {
            this.request_time = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
        }
        /// <summary>
        /// 商户代码
        /// 海淘乐分配给各合作商户的唯一识别码
        /// </summary>
        public string alliance_code { get; set; }
        /// <summary>
        /// 请求时间
        /// yyyy-MM-dd hh:mm:ss
        /// </summary>
        public string request_time { get; set; }
        /// <summary>
        /// 签名
        /// MD5 ( alliance_code + "|" + request_time + "|" + secret_key )
        /// 其中secret_key为海淘乐分配给各合作商户的32位的商户密钥，系统分配
        /// </summary>
        public string sign { get; set; }
    }
    /// <summary>
    /// 响应结果
    /// </summary>
    public class htl_res_base {
        /// <summary>
        /// 返回代码
        /// 200: 提交成功
        /// 300: 您不是合法用户
        /// 400: 请求参数填写不完整
        /// 500: 服务器错误,请过段时间推送
        /// …
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 提示信息
        /// </summary>
        public string message { get; set; }
        /// <summary>
        /// 请求时间
        /// yyyy-MM-dd hh:mm:ss
        /// </summary>
        public string request_time { get; set; }
    }
    #endregion

    #region 商品数据推送接口
    /// <summary>
    /// 接收商品数据推送接口
    /// </summary>
    public class htl_product_req : htl_req_base {
        /// <summary>
        /// 商品数据接收地址
        /// 合作商户提供给海淘乐的商品数据接收地址
        /// </summary>
        public string request_url { get; set; }
        /// <summary>
        /// 商品数据
        /// 海淘乐按约定范围内推送给各合作商户的商品
        /// </summary>
        public string products_xml { get; set; }
    }
    /// <summary>
    /// 商品响应输出结果
    /// </summary>
    public class response {
        /// <summary>
        /// 商户代码
        /// 海淘乐分配给各合作商户的唯一识别码
        /// </summary>
        public string alliance_code { get; set; }
        /// <summary>
        /// 请求时间
        /// yyyy-MM-dd hh:mm:ss
        /// </summary>
        public string request_time { get; set; }
        /// <summary>
        /// 处理状态
        /// 1 – 成功
        /// 2 – 失败
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 错误文字信息
        /// 如果处理失败，则反馈失败原因
        /// </summary>
        public string error { get; set; }
        /// <summary>
        /// MD5加密签名
        /// MD5 ( alliance_code + "|" + request_time + "|" + status  + "|" + error + "|" + secret_key )
        /// 其中secret_key为海淘乐分配给各合作商户的32位的商户密钥，系统分配
        /// </summary>
        public string sign { get; set; }
    } 
    #endregion

    #region 商品数据查询
    /// <summary>
    /// 商品查询接口
    /// </summary>
    public class htl_product_search_req : htl_req_base {
        /// <summary>
        /// 初始化
        /// </summary>
        public htl_product_search_req() {
            this.page = 1;
        }
        /// <summary>
        /// 查询商品的SKU，多个以半角逗号(,)隔开，最多100个
        /// </summary>
        public string skus { get; set; }
        /// <summary>
        /// 商品类目ID
        /// </summary>
        public int categories_id { get; set; }
        /// <summary>
        /// 商品创建开始时间
        /// </summary>
        public string products_create_start_time { get; set; }
        /// <summary>
        /// 商品创建结束时间
        /// </summary>
        public string products_update_start_time { get; set; }
        /// <summary>
        /// 商品更新结束时间
        /// </summary>
        public string products_update_end_time { get; set; }
        /// <summary>
        /// 页数,（不填默认为1）
        /// </summary>
        public int page { get; set; }
    }
    /// <summary>
    /// 商品数据查询响应结果
    /// </summary>
    [XmlType("response")]
    public class htl_product_search_res : htl_res_base {
        /// <summary>
        /// 返回商品数据的当前页数
        /// </summary>
        public int page { get; set; }
        /// <summary>
        /// 查询商品数据的总页数
        /// </summary>
        public int total_page { get; set; }
        /// <summary>
        /// 查询商品数据的总数
        /// </summary>
        public int total_num { get; set; }
        /// <summary>
        /// 返回商品信息
        /// </summary>
        public products_list products_list { get; set; }
    }
    /// <summary>
    /// 商品数组
    /// </summary>
    public class products_list {
        /// <summary>
        /// 商品信息
        /// </summary>
        [XmlElement("product")]
        public List<product> product { get; set; }
    }
    /// <summary>
    /// 商品信息
    /// </summary>
    public class product {
        /// <summary>
        /// 商品ID
        /// 对应海淘乐系统商品ID
        /// </summary>
        public int products_id { get; set; }
        /// <summary>
        /// 商品唯一编码
        /// </summary>
        public string sku { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string products_name { get; set; }
        /// <summary>
        /// 代理价
        /// 海淘乐给各合作商户的代理价(如果没有价格则为空)
        /// </summary>
        public agent_prices agent_prices { get; set; }
        /// <summary>
        /// 建议销售价
        /// 对应海淘乐系统的销售价格
        /// </summary>
        public decimal sales_price { get; set; }
        /// <summary>
        /// 市场价
        /// </summary>
        public decimal market_price { get; set; }
        /// <summary>
        /// 商品库存
        /// 海淘乐系统的商品库存
        /// </summary>
        public int quantity { get; set; }
        /// <summary>
        /// 一级类目ID
        /// 对应海淘乐系统的一级类目ID
        /// </summary>
        public int first_categories_id { get; set; }
        /// <summary>
        /// 一级类目名称
        /// 对应海淘乐系统的一级类目名称
        /// </summary>
        public string first_categories_name { get; set; }
        /// <summary>
        /// 二级类目ID
        /// 对应海淘乐系统的二级类目ID
        /// </summary>
        public int second_categories_id { get; set; }
        /// <summary>
        /// 二级类目名称
        /// 对应海淘乐系统的二级类目名称
        /// </summary>
        public string second_categories_name { get; set; }
        /// <summary>
        /// 三级类目ID
        /// 对应海淘乐系统的三级类目ID
        /// </summary>
        public int third_categories_id { get; set; }
        /// <summary>
        /// 三级类目名称 
        /// 对应海淘乐系统的三级类目名称
        /// </summary>
        public string third_categories_name { get; set; }
        /// <summary>
        /// 商品的重量，单位克(g)
        /// </summary>
        public decimal weight { get; set; }
        /// <summary>
        /// 运费ID
        /// 对应海淘乐系统该的运费信息ID，包邮的情况下为0，如果多个运费，就用逗号隔开
        /// </summary>
        public string express_id { get; set; }
        /// <summary>
        /// 仓储费ID
        /// 对应海淘乐系统该的仓储费信息ID，包邮或无仓储费的情况下为0
        /// </summary>
        public int store_expenses_id { get; set; }
        /// <summary>
        /// 库存方式
        /// 1 – 保税仓
        /// 2 – 直邮
        /// 3 – 现货
        /// </summary>
        public int store_type { get; set; }
        /// <summary>
        /// 商品状态
        /// 1 – 上架
        /// 2 – 下架
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 产地
        /// </summary>
        public string producing_area { get; set; }
        /// <summary>
        /// 品牌ID
        /// </summary>
        public int brands_id { get; set; }
        /// <summary>
        /// 品牌名称
        /// </summary>
        public string brands_name { get; set; }
        /// <summary>
        /// 规格名称
        /// </summary>
        public string specification { get; set; }
        /// <summary>
        /// 单位
        /// </summary>
        public string unit { get; set; }
        /// <summary>
        /// 保质期
        /// </summary>
        public string shelf_life { get; set; }
        /// <summary>
        /// 最高购买量/单
        /// 最高购买数量（0表示不限制）
        /// </summary>
        public int max_quantity { get; set; }
        /// <summary>
        /// 最低起购量/单
        /// 单笔订单最低起购量
        /// </summary>
        public int min_quantity { get; set; }
        /// <summary>
        /// 单位数量/次
        /// </summary>
        public int unit_quantity { get; set; }
        /// <summary>
        /// 商品是否可搭配购买
        /// 商品是否可搭配购买（0：否，1：是）
        /// </summary>
        public int is_collocation { get; set; }
        /// <summary>
        /// 促销标签
        /// </summary>
        public string tag_name { get; set; }
        /// <summary>
        /// 商品简要描述
        /// </summary>
        public string brief_description { get; set; }
        /// <summary>
        /// 商品详细描述
        /// </summary>
        public string description { get; set; }
        /// <summary>
        /// 商品主图
        /// </summary>
        public string main_image_url { get; set; }
        /// <summary>
        /// 商品附图
        /// 多个图片链接以‘|’分割
        /// </summary>
        public string image_url { get; set; }
        /// <summary>
        /// 操作状态
        /// 1 – 添加，表示没有推送过该商品
        /// 2 – 修改，表示之前已经推送过该商品，但海淘乐系统有更新信息
        /// </summary>
        public int request_status { get; set; }
        /// <summary>
        /// 仓储名称
        /// </summary>
        public string store_name { get; set; }
        /// <summary>
        /// 海关
        /// </summary>
        public string customs_name { get; set; }
    }
    /// <summary>
    /// 代理费
    /// </summary>
    public class agent_prices {
        /// <summary>
        /// 代理费
        /// </summary>
        [XmlElement("agent_price")]
        public List<agent_price> agent_price { get; set; }
    }
    /// <summary>
    /// 价格区间
    /// </summary>
    public class agent_price {
        /// <summary>
        /// 商品数量区间（开始值）
        /// </summary>
        public int start_quantity { get; set; }
        /// <summary>
        /// 商品数量区间（结束值）
        /// </summary>
        public string end_quantity { get; set; }
        /// <summary>
        /// 商品数量区间对应的代理价
        /// </summary>
        public decimal price { get; set; }
    }
    #endregion

    #region 推送订单
    /// <summary>
    /// 发送订单数据接口
    /// </summary>
    public class htl_order_req : htl_req_base {
        /// <summary>
        /// 订单信息
        /// </summary>
        public string order { get; set; }
    }
    /// <summary>
    /// 订单xml结构
    /// </summary>
    public class channel {
        /// <summary>
        /// 初始化数据
        /// </summary>
        public channel() {
            title = "订单信息";
        }
        /// <summary>
        /// 标题
        /// </summary>
        public string title { get; set; }
        /// <summary>
        /// 订单信息
        /// </summary>
        public htl_order item { get; set; }
    }
    /// <summary>
    /// 订单信息
    /// </summary>
    public class htl_order {
        /// <summary>
        /// 自定义订单号，不可重复
        /// </summary>
        public string custom_orders_number { get; set; }
        /// <summary>
        /// 收货省份名称
        /// </summary>
        public string shipping_province { get; set; }
        /// <summary>
        /// 收货城市名称
        /// </summary>
        public string shipping_city { get; set; }
        /// <summary>
        /// 收货区县名称
        /// </summary>
        public string shipping_district { get; set; }
        /// <summary>
        /// 收货街道地址
        /// </summary>
        public string shipping_address { get; set; }
        /// <summary>
        /// 收货地址邮编
        /// </summary>
        public string shipping_postcode { get; set; }
        /// <summary>
        /// 订单备注
        /// </summary>
        public string comments { get; set; }
        /// <summary>
        /// 若无运费ID则填0
        /// </summary>
        public int express_id { get; set; }
        /// <summary>
        /// 运费金额
        /// </summary>
        public decimal express_amount { get; set; }
        /// <summary>
        /// 若无仓储费ID则填0
        /// </summary>
        public int store_expenses_id { get; set; }
        /// <summary>
        /// 仓储费金额
        /// </summary>
        public decimal store_amount { get; set; }
        /// <summary>
        /// 订单商品信息(必须有一条商品信息)
        /// </summary>
        public order_produts order_products { get; set; }
        /// <summary>
        /// 支付方式
        /// 日期格式(yyyy-MM-dd hh:mm:ss)
        /// </summary>
        public string alliances_payment_date { get; set; }
        /// <summary>
        /// 支付方式
        /// </summary>
        public string alliances_payment_method { get; set; }
        /// <summary>
        /// 支付流水号
        /// </summary>
        public string alliances_payment_serial { get; set; }
        /// <summary>
        /// 订单收货身份信息(必须要有一条收货地址）
        /// </summary>
        public order_shipping_info order_shipping_info { get; set; }
    }
    /// <summary>
    /// 订单商品
    /// </summary>
    public class order_produts {
        /// <summary>
        /// 
        /// </summary>
        public order_produts() {
            product = new List<order_product>();
        }
        /// <summary>
        /// 商品信息
        /// </summary>
        [XmlElement("product")]
       public List<order_product> product { get; set; }
    }
    /// <summary>
    /// 订单商品数据
    /// </summary>
    [XmlType("product")]
    public class order_product {
        /// <summary>
        /// SKU
        /// </summary>
        public string sku { get; set; }
        /// <summary>
        /// 商品数量
        /// </summary>
        public int products_qty { get; set; }
        /// <summary>
        /// 代理单价
        /// </summary>
        public decimal sales_price { get; set; }
    }
    /// <summary>
    /// 订单收货地址
    /// </summary>
    public class order_shipping_info {
        /// <summary>
        /// 收货地址详细信息
        /// </summary>
        [XmlElement("shipping_info")]
        public List<shipping_info> shipping_info { get; set; }
    }
    /// <summary>
    /// 收货地址详细信息
    /// </summary>
    public class shipping_info {
        /// <summary>
        /// 收货人手机号码
        /// </summary>
        public string shipping_telephone { get; set; }
        /// <summary>
        /// 收货人姓名
        /// </summary>
        public string shipping_customers_name { get; set; }
        /// <summary>
        /// 身份证号码
        /// 直邮、现货订单选填；保税仓订单必填
        /// </summary>
        public string shipping_customers_identity { get; set; }
        /// <summary>
        /// 身份证姓名
        /// 直邮、现货订单选填；保税仓订单必填
        /// </summary>
        public string shipping_customers_identity_name { get; set; }
    }
    #endregion

    #region 推送订单响应结果
    /// <summary>
    /// 订单结果返回数据
    /// </summary>
    [XmlType("response")]
    public class htl_order_res : htl_res_base {
        /// <summary>
        /// 自定义订单号
        /// </summary>
        public string custom_orders_number { get; set; }
        /// <summary>
        /// 返回订单信息
        /// </summary>
        public htl_orders_info orders_info { get; set; }
    }
    /// <summary>
    /// 返回订单信息
    /// </summary>
    [XmlType("orders_info")]
    public class htl_orders_info {
        /// <summary>
        /// 订单信息
        /// </summary>
        public htl_push_order order { get; set; }
    }
    /// <summary>
    /// 订单信息
    /// </summary>
    [XmlType("order")]
    public class htl_push_order {
        /// <summary>
        /// 系统订单号
        /// </summary>
        public string orders_model { get; set; }
        /// <summary>
        /// 运费金额
        /// </summary>
        public decimal express_amount { get; set; }
        /// <summary>
        /// 仓储费金额
        /// </summary>
        public decimal store_amount { get; set; }
        /// <summary>
        /// 返回订单商品信息
        /// </summary>
        public order_products order_products { get; set; }
    }
    /// <summary>
    /// 返回订单商品信息
    /// </summary>
    public class order_products {
        /// <summary>
        /// 商品信息
        /// </summary>
        [XmlElement("product")]
        public List<push_product> product { get; set; }
    }
    /// <summary>
    /// 商品信息
    /// </summary>
    [XmlType("product")]
    public class push_product {
        /// <summary>
        /// SKU
        /// </summary>
        public string sku { get; set; }
        /// <summary>
        /// 商品数量
        /// </summary>
        public int products_qty { get; set; }
        /// <summary>
        /// 实际单价
        /// </summary>
        public decimal sales_price { get; set; }
    }
    #endregion

    #region 货运方式查询
    /// <summary>
    /// 货运方式响应结果
    /// </summary>
    [XmlType("response")]
    public class htl_shipping_res : htl_res_base {
        /// <summary>
        /// 返回货运方式信息
        /// </summary>
        public shipping_method_info shipping_method_info { get; set; }
    }
    /// <summary>
    /// 返回货运方式信息
    /// </summary>
    public class shipping_method_info {
        /// <summary>
        /// 货运方式
        /// </summary>
        [XmlElement("shipping_method")]
        public List<shipping_method> shipping_method { get; set; }
    }
    /// <summary>
    /// 货运方式
    /// </summary>
    public class shipping_method {
        /// <summary>
        /// 货运方式ID
        /// </summary>
        public int shipping_method_id { get; set; }
        /// <summary>
        /// 货运方式名称
        /// </summary>
        public string shipping_method_name { get; set; }
    }
    #endregion

    #region 物流查询接口
    /// <summary>
    /// 物流查询接口
    /// </summary>
    public class htl_logistics_req : htl_req_base {
        /// <summary>
        /// 订单信息
        /// 要查询物流的订单信息
        /// </summary>
        public string orders_info { get; set; }
    }
    /// <summary>
    /// 物流查询返回结果
    /// </summary>
    [XmlType("response")]
    public class htl_logistics_res : htl_res_base {
        /// <summary>
        /// 返回物流信息
        /// </summary>
        public htl_shipping_info shipping_info { get; set; }
    }
    /// <summary>
    /// 物流信息
    /// </summary>
    [XmlType("shipping_info")]
    public class htl_shipping_info {
        /// <summary>
        /// 物流信息
        /// </summary>
        public shipping shipping { get; set; }
    }
    /// <summary>
    /// 物流信息
    /// </summary>
    public class shipping {
        /// <summary>
        /// 系统订单号
        /// </summary>
        public string orders_model { get; set; }
        /// <summary>
        /// 自定义订单号
        /// </summary>
        public string custom_orders_number { get; set; }
        /// <summary>
        /// 物流运单信息
        /// </summary>
        public logistics_infos logistics_infos { get; set; }
    }
    /// <summary>
    /// 返回物流运单信息
    /// </summary>
    public class logistics_infos {
        /// <summary>
        /// 物流运单列表
        /// </summary>
        [XmlElement("logistics_info")]
        public List<logistics_info> logistics_info { get; set; }
    }
    /// <summary>
    /// 物流运单信息
    /// </summary>
    public class logistics_info {
        /// <summary>
        /// 物流单号
        /// </summary>
        public string express_number { get; set; }
        /// <summary>
        /// 货运公司
        /// </summary>
        public string express_name { get; set; }
        /// <summary>
        /// 海淘乐的快递编码
        /// </summary>
        public string haitaole_code { get; set; }
    }

    #endregion

    #region 运费查询
    /// <summary>
    /// 运费查询请求接口
    /// </summary>
    public class htl_freight_req : htl_req_base {
        /// <summary>
        /// 运费id
        /// 查询运费的ID，多个以半角逗号(,)隔开，最多50个
        /// </summary>
        public string express_ids { get; set; }
    }
    /// <summary>
    /// 运费查询响应结果
    /// </summary>
    [XmlType("response")]
    public class htl_freight_res : htl_res_base {
        /// <summary>
        /// 返回运费信息
        /// </summary>
        public express_list express_list { get; set; }
    }
    /// <summary>
    /// 返回运费信息
    /// </summary>
    public class express_list {
        /// <summary>
        /// 快递信息
        /// </summary>
        [XmlElement("express")]
        public List<express> express { get; set; }
    }
    /// <summary>
    /// 快递信息
    /// </summary>
    public class express {
        /// <summary>
        /// 运费ID
        /// 对应海淘乐系统运费ID
        /// </summary>
        public int express_id { get; set; }
        /// <summary>
        /// 配送方式
        /// </summary>
        public string shipping_method_name { get; set; }
        /// <summary>
        /// 运费类型
        /// 1：按件或按重量
        /// 2：区间收费
        /// </summary>
        public int express_type { get; set; }
        /// <summary>
        /// 运费状态
        /// 0：关闭
        /// 1：开启
        /// </summary>
        public int express_status { get; set; }
        /// <summary>
        /// 运费区域信息
        /// </summary>
        public express_fee_list express_fee_list { get; set; }
    }
    /// <summary>
    /// 运费区域信息
    /// </summary>
    public class express_fee_list {
        /// <summary>
        /// 运费信息
        /// </summary>
        public express_fee_info express_fee_info { get; set; }
    }
    /// <summary>
    /// 运费信息
    /// </summary>
    public class express_fee_info {
        /// <summary>
        /// 运费区域ID
        /// </summary>
        public int express_fee_id { get; set; }
        /// <summary>
        /// 区域名称
        /// </summary>
        public string area_name { get; set; }
        /// <summary>
        /// 是否包邮
        /// 0：否
        /// 1：是
        /// </summary>
        public int express_free { get; set; }
        /// <summary>
        /// 区域范围省
        /// </summary>
        [XmlElement("express_area_list")]
        public List<express_area_list> express_area_list { get; set; }
        /// <summary>
        /// 计费方式
        /// 1：按件
        /// 2：按重量
        /// </summary>
        public int charge_mode { get; set; }
        /// <summary>
        /// 首重或首件数量(按件则为首件，按重量则为首重)
        /// </summary>
        public decimal start_number { get; set; }
        /// <summary>
        /// 首重或首件费用(按件则为首件，按重量则为首重)
        /// </summary>
        public decimal start_fee { get; set; }
        /// <summary>
        /// 续重或续件数量(按件则为续件，按重量则为续重)
        /// </summary>
        public decimal add_number { get; set; }
        /// <summary>
        /// 续重或续件费用(按件则为续件，按重量则为续重)
        /// </summary>
        public decimal add_fee { get; set; }
        /// <summary>
        /// 区间收费信息
        /// </summary>
        [XmlElement("express_price_area_list")]
        public List<express_price_area_list> express_price_area_list { get; set; }
    }
    /// <summary>
    /// 区域范围省
    /// </summary>
    public class express_area_list {
        /// <summary>
        /// 地区代码
        /// </summary>
        public string express_areacode { get; set; }
        /// <summary>
        /// 地区名称
        /// </summary>
        public string express_areaname { get; set; }
    }
    /// <summary>
    /// 区间收费列表
    /// </summary>
    public class express_price_area_list {
        /// <summary>
        /// 区间收费信息
        /// </summary>
        [XmlElement("express_price_area")]
        public List<express_price_area> express_price_area { get; set; }
    }
    /// <summary>
    /// 区间收费信息
    /// </summary>
    public class express_price_area {
        /// <summary>
        /// 起始重量
        /// </summary>
        public decimal start_number { get; set; }
        /// <summary>
        /// 结束重量
        /// </summary>
        public decimal end_number { get; set; }
        /// <summary>
        /// 区间价格
        /// 对应运费
        /// </summary>
        public decimal price { get; set; }
    }

    #endregion

    #region 仓储费查询
    /// <summary>
    /// 仓储费请求接口
    /// </summary>
    public class htl_store_expenses_req:htl_req_base {
        /// <summary>
        /// 仓储费id
        /// 查询仓储费的ID，多个以半角逗号(,)隔开，最多50个
        /// </summary>
        public string store_expenses_ids { get; set; }
    }
    /// <summary>
    /// 仓储费响应结果
    /// </summary>
    [XmlType("response")]
    public class htl_store_expenses_res : htl_res_base {
        /// <summary>
        /// 返回仓储费信息
        /// </summary>
        public store_expenses_list store_expenses_list { get; set; }
    }
    /// <summary>
    /// 仓储费信息
    /// </summary>
    public class store_expenses_list {
        /// <summary>
        /// 仓储费信息
        /// </summary>
        public store_expenses store_expenses { get; set; }
    }
    /// <summary>
    /// 仓储费信息
    /// </summary>
    public class store_expenses {
        /// <summary>
        /// 仓储费ID
        /// 对应海淘乐系统运费ID
        /// </summary>
        public int store_expenses_id { get; set; }
        /// <summary>
        /// 仓储费状态
        /// 0：关闭
        /// 1：开启
        /// </summary>
        public int status { get; set; }
        /// <summary>
        /// 价格信息
        /// </summary>
        [XmlElement("prices_list")]
        public List<prices_list> prices_list { get; set; }
    }
    /// <summary>
    /// 价格信息
    /// </summary>
    public class prices_list {
        /// <summary>
        /// 商品数量
        /// </summary>
        public int quantity { get; set; }
        /// <summary>
        /// 价格
        /// </summary>
        public decimal products_price { get; set; }
    }

    #endregion

    #region 订单状态查询
    /// <summary>
    /// 订单状态请求接口
    /// </summary>
    public class htl_orders_info_req : htl_req_base {
        /// <summary>
        /// 订单信息
        /// 查询订单状态信息的系统订单号或自定义订单号
        /// </summary>
        public string orders_info { get; set; }
    }
    /// <summary>
    /// 订单状态对象
    /// </summary>
    [XmlType("orders_info")]
    public class order_status_info {
        /// <summary>
        /// 
        /// </summary>
        public order_status_info() {
            order = new List<order_status>();
        }
        /// <summary>
        /// 订单信息
        /// </summary>
        [XmlElement("order")]
        public List<order_status> order { get; set; }
    }
    /// <summary>
    /// 订单信息
    /// </summary>
    [XmlType("order")]
    public class order_status {
        /// <summary>
        /// 订单号
        /// </summary>
        public string orders_model { get; set; }
        /// <summary>
        /// 系统订单号
        /// </summary>
        public string custom_orders_number { get; set; }
    }

    /// <summary>
    /// 订单状态响应结果
    /// </summary>
    [XmlType("response")]
    public class htl_orders_info_res : htl_res_base {
        /// <summary>
        /// 订单状态信息
        /// </summary>
        public htl_orders_res orders_info { get; set; }
    }
    /// <summary>
    /// 返回订单状态信息
    /// </summary>
    [XmlType("orders_info")]
    public class htl_orders_res {
        /// <summary>
        /// 订单状态
        /// </summary>
        [XmlElement("order")]
        public List<htl_order_status> order { get; set; }
    }
    /// <summary>
    /// 订单状态
    /// </summary>
    [XmlType("order")]
    public class htl_order_status {
        /// <summary>
        /// 系统订单号
        /// </summary>
        public string orders_model { get; set; }
        /// <summary>
        /// 自定义订单号
        /// </summary>
        public string custom_orders_number { get; set; }
        /// <summary>
        /// 订单更新时间
        /// </summary>
        public string gmt_modified { get; set; }
        /// <summary>
        /// 订单状态编码
        /// </summary>
        public string orders_status_code { get; set; }
        /// <summary>
        /// 订单状态
        /// </summary>
        public string orders_status { get; set; }
        /// <summary>
        /// 支付状态编码
        /// </summary>
        public string payment_code { get; set; }
        /// <summary>
        /// 支付状态
        /// </summary>
        public string payment_status { get; set; }
    }
    #endregion

    #region 订单查询
    /// <summary>
    /// 订单查询请求接口
    /// </summary>
    public class htl_order_search_req : htl_req_base {
        /// <summary>
        /// 系统订单号
        /// </summary>
        public string orders_model { get; set; }
        /// <summary>
        /// 自定义订单号
        /// </summary>
        public string custom_orders_number { get; set; }
        /// <summary>
        /// 订单状态编码
        /// </summary>
        public string orders_status_code { get; set; }
        /// <summary>
        /// 支付状态编码
        /// </summary>
        public string payment_code { get; set; }
        /// <summary>
        /// 查询时间类型
        /// 1：订单创建时间
        /// 2：订单更新时间
        /// (当前字段填写时，则下面的开始时间和结束时间至少填写一个)
        /// </summary>
        public int time_type { get; set; }
        /// <summary>
        /// 订单开始时间
        /// </summary>
        public string start_time { get; set; }
        /// <summary>
        /// 订单结束时间
        /// </summary>
        public string end_time { get; set; }
        /// <summary>
        /// 当前页数
        /// 查询订单信息的页数，大于0的整数，不填默认为1
        /// (每次返回的数据超过100条，需分页来查询)
        /// </summary>
        public int page { get; set; }
    }
    /// <summary>
    /// 订单查询响应结果
    /// </summary>
    [XmlType("response")]
    public class htl_order_search_res : htl_res_base {
        /// <summary>
        /// 当前页数
        /// </summary>
        public int page { get; set; }
        /// <summary>
        /// 总页数
        /// </summary>
        public int total_page { get; set; }
        /// <summary>
        /// 订单总数
        /// </summary>
        public int total_num { get; set; }
        /// <summary>
        /// 返回订单信息
        /// </summary>
        public orders_info orders_info { get; set; }
    }
    /// <summary>
    /// 订单信息
    /// </summary>
    public class orders_info {
        /// <summary>
        /// 订单信息
        /// </summary>
        [XmlElement("order")]
        public List<htl_order_search> order { get; set; }
    }
    /// <summary>
    /// 订单信息
    /// </summary>
    [XmlType("order")]
    public class htl_order_search {
        /// <summary>
        /// 系统订单号
        /// </summary>
        public string orders_model { get; set; }
        /// <summary>
        /// 自定义订单号
        /// </summary>
        public string custom_orders_number { get; set; }
        /// <summary>
        /// 订单创建时间
        /// </summary>
        public string orders_create_time { get; set; }
        /// <summary>
        /// 收货人手机号码
        /// </summary>
        public string shipping_telephone { get; set; }
        /// <summary>
        /// 收货人姓名
        /// </summary>
        public string shipping_customers_name { get; set; }
        /// <summary>
        /// 身份证号码
        /// </summary>
        public string shipping_customers_identity { get; set; }
        /// <summary>
        /// 身份证姓名
        /// </summary>
        public string shipping_customers_identity_name { get; set; }
        /// <summary>
        /// 收货省份名称
        /// </summary>
        public string shipping_province { get; set; }
        /// <summary>
        /// 收货城市名称
        /// </summary>
        public string shipping_city { get; set; }
        /// <summary>
        /// 收货区县名称
        /// </summary>
        public string shipping_district { get; set; }
        /// <summary>
        /// 收货街道地址
        /// </summary>
        public string shipping_address { get; set; }
        /// <summary>
        /// 收货地址邮编
        /// </summary>
        public string shipping_postcode { get; set; }
        /// <summary>
        /// 订单备注
        /// </summary>
        public string comments { get; set; }
        /// <summary>
        /// 运费金额
        /// </summary>
        public decimal express_fee { get; set; }
        /// <summary>
        /// 仓储费
        /// </summary>
        public decimal store_fee { get; set; }
        /// <summary>
        /// 综合税率
        /// </summary>
        public decimal tax_rate { get; set; }
        /// <summary>
        /// 综合税
        /// </summary>
        public decimal tax_fee { get; set; }
        /// <summary>
        /// 优惠价
        /// </summary>
        public decimal change_fee { get; set; }
        /// <summary>
        /// 库存方式
        /// 1:保税仓
        /// 2:直邮
        /// 3:现货
        /// </summary>
        public int store_type { get; set; }
        /// <summary>
        /// 订单状态编码
        /// </summary>
        public string orders_status_code { get; set; }
        /// <summary>
        /// 订单状态
        /// </summary>
        public string orders_status { get; set; }
        /// <summary>
        /// 支付状态编码
        /// </summary>
        public string payment_code { get; set; }
        /// <summary>
        /// 支付状态
        /// </summary>
        public string payment_status { get; set; }
        /// <summary>
        /// 订单商品信息
        /// </summary>
        public order_product_search orders_products_info { get; set; }
    }
    /// <summary>
    /// 订单商品信息
    /// </summary>
    [XmlType("orders_products_info")]
    public class order_product_search {
        /// <summary>
        /// 订单商品
        /// </summary>
        [XmlElement("orders_product")]
        public List<orders_product> orders_product { get; set; }
    }
    /// <summary>
    /// 订单商品
    /// </summary>
    public class orders_product {
        /// <summary>
        /// sku
        /// </summary>
        public string sku { get; set; }
        /// <summary>
        /// 商品名称
        /// </summary>
        public string products_name { get; set; }
        /// <summary>
        /// 商品数量
        /// </summary>
        public string products_quantity { get; set; }
        /// <summary>
        /// 销售价
        /// </summary>
        public decimal sales_price { get; set; }
    }
    #endregion

    #region 订单取消
    /// <summary>
    /// 订单取消请求接口
    /// </summary>
    public class htl_order_cancel_req : htl_req_base {
        /// <summary>
        /// 查询订单状态信息的系统订单号或自定义订单号
        /// </summary>
        public string orders_info { get; set; }
    }
    /// <summary>
    /// 订单取消xml结构
    /// </summary>
    [XmlType("orders_info")]
    public class orders_cancel_info {
        /// <summary>
        /// 
        /// </summary>
        public orders_cancel_info() {
            order = new List<htl_order_cancel>();
        }
        /// <summary>
        /// 订单取消数据
        /// </summary>
        [XmlElement("order")]
        public List<htl_order_cancel> order { get; set; }
    }
    /// <summary>
    /// 订单取消数据
    /// </summary>
    [XmlType("order")]
    public class htl_order_cancel {
        /// <summary>
        /// 系统订单号
        /// </summary>
        public string orders_model { get; set; }
        /// <summary>
        /// 自定义订单号
        /// </summary>
        public string custom_orders_number { get; set; }
        /// <summary>
        /// 取消订单备注
        /// </summary>
        public string remark { get; set; }
    }

    #endregion
}
